# $Id: PKGBUILD 182404 2013-04-10 06:49:54Z eric $
# Maintainer : Ionut Biru <ibiru@archlinux.org>
# Contributor: Juergen Hoetzel <juergen@archlinux.org>
# Contributor:  Douglas Soares de Andrade <douglas@archlinux.org>

pkgname=twisted
pkgver=13.0.0
pkgrel=1
pkgdesc="Asynchronous networking framework written in Python"
arch=('i686' 'x86_64')
url="http://twistedmatrix.com/"
license=('MIT')
depends=('python2-crypto' 'python2-zope-interface')
optdepends=('python2-pyopenssl'
            'python2-soappy: for twisted.web.soap'
	    'python2-pyasn1: for using conch'
	    'pygtk: for using manhole'
	    'tk: for using tkconch')
install=twisted.install
source=(http://twistedmatrix.com/Releases/Twisted/${pkgver%.*}/Twisted-$pkgver.tar.bz2)
sha1sums=('5c66a4f231a5f3e17860a41498ac80e76a156dca')

prepare() {
    cd "Twisted-$pkgver"
    sed -i 's:^#!.*bin.*python:#!/usr/bin/python2:' \
      twisted/python/test/pullpipe.py \
      twisted/mail/test/pop3testserver.py \
      twisted/trial/test/scripttest.py
}

build() {
    cd "Twisted-$pkgver"
    python2 setup.py build
}

package() {
    cd "Twisted-$pkgver"
    python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1
    install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
